<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@ page import="com.fc.util.*" %>
<%@ page import="com.fc.model.*" %>
<%@ page import="com.fc.control.*" %>
<%
	request.setCharacterEncoding("utf-8");
	int coachId = Integer.parseInt(request.getParameter("coachId"));
	//System.out.print(coachId);
	Coach coach = new Coach();
	coach = CoachControl.getCoachInfo(coachId);
	String position = new String(request.getParameter("position").getBytes("iso8859-1"),"utf-8");
	int wages = Integer.parseInt(request.getParameter("wages"));
	int price = Integer.parseInt(request.getParameter("price"));
	int experience = Integer.parseInt(request.getParameter("experience"));
	coach.setPosition(position);
	coach.setWages(wages);
	coach.setPrice(price);
	coach.setExperience(experience);
	boolean isSuccess = CoachControl.updateCoach(coach, coachId);
	String returnJson = "{\"status\":\"" + (isSuccess ?  1 : 0) + "\"}";
%>
<%=returnJson %>